package br.perfiman.faces;

import br.perfiman.model.Asset;
import br.perfiman.service.AbstractService;
import br.perfiman.utils.ServiceLocator;

public class AssetBean extends AbstractBean<Asset> {

	public AssetBean() throws Exception {
		super();
		if(getEntity() == null)
			setEntity(new Asset());
		retrieveAll();
	}

	@Override
	@SuppressWarnings("unchecked")
	protected AbstractService<Asset> getService() throws Exception {
		if(service == null){
			service = (AbstractService<Asset>) ServiceLocator.getInstance().get("AssetServiceBean/remote");
		}
		return service;
	}
}
